﻿@model MVC.Models.Pessoa

@{
    ViewBag.Title = "EditarProfile";
    int id = Model.PessoaId;
}

<h2>EditarProfile</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Pessoa</legend>
                        
        @Html.Hidden("id",id)
        @Html.HiddenFor(model => model.UserId)
        @Html.HiddenFor(model => model.NumeroContribuinte)
        @Html.HiddenFor(model => model.Role)
        @Html.HiddenFor(model => model.Nome)

        <div class="editor-label">
            @Html.LabelFor(model => model.Nome)
        </div>
        <div class="editor-field">
            @Html.DisplayFor(model => model.Nome)           
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Morada)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Morada)
            @Html.ValidationMessageFor(model => model.Morada)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Telefone)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Telefone)
            @Html.ValidationMessageFor(model => model.Telefone)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Telemovel)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Telemovel)
            @Html.ValidationMessageFor(model => model.Telemovel)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Email)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </div>        
                  
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back", "Index")
</div>
